let token = Cookies.get('info');
// console.log(token);
let zonghe = document.querySelector('section .zonghe');
let remen = document.querySelector('section .remen');
let xinzeng = document.querySelector('section .xinzeng');
let li01 = document.querySelector('.li-1');
let li02 = document.querySelector('.li-2');
let li03 = document.querySelector('.li-3');
// console.log(li01, li02)
li01.onclick = function() {
    zonghe.style.display = 'block';
    remen.style.display = 'none';
    xinzeng.style.display = 'none';
    zongHe()
}

zongHe()
    //综合
function zongHe() {
    axios.post(privateApi, {
        token,
        "pageNum": 1,
        "pageSize": 10
    }).then(res => {
        console.log(res.data.info);
        let obj = res.data.info;
        let html = '';
        for (let i = 0; i < obj.length; i++) {
            // console.log(obj[i]);
            let pObj = obj[i];
            html += `
                <div class="lister">
                    <div class="list">
                        <img src="${pObj.classImgUrl}" alt="">
                        <ul class="goods">
                            <li class="goods-01">
                                <h3>${pObj.className}</h3>
                                <p class="goods-p1">导师：${pObj.teacher.username}</p>
                            </li>
                            <li class="goods-02">
                                <h3>${pObj.className}</h3>
                                <p class="goods-p2">${pObj.classNumber}</p>
                            </li>
                        </ul>
                    </div>
                </div>
            `
        }
        zonghe.innerHTML = html;
    })
}

li02.onclick = function() {
    remen.style.display = 'block';
    zonghe.style.display = 'none';
    xinzeng.style.display = 'none';
    axios.post(hottestClassApi, {
        token,
        "pageNum": 1,
        "pageSize": 10
    }).then(res => {
        console.log(res.data.info);
        let obj = res.data.info;
        let html = '';
        for (let i = 0; i < obj.length; i++) {
            // console.log(obj[i]);
            let pObj = obj[i];
            html += `
                <div class="lister">
                    <div class="list">
                        <img src="${pObj.classImgUrl}" alt="">
                        <ul class="goods">
                            <li class="goods-01">
                                <h3>${pObj.className}</h3>
                                <p class="goods-p1">导师：${pObj.teacher.username}</p>
                            </li>
                            <li class="goods-02">
                                <h3>${pObj.className}</h3>
                                <p class="goods-p2">${pObj.classNumber}</p>
                            </li>
                        </ul>
                    </div>
                </div>
            `
        }
        remen.innerHTML = html;
    })
}

li03.onclick = function() {
    remen.style.display = 'none';
    zonghe.style.display = 'none';
    xinzeng.style.display = 'block';
    axios.post(hottestClassApi, {
        token,
        "pageNum": 1,
        "pageSize": 10
    }).then(res => {
        // console.log(res.data.info);
        let obj = res.data.info;
        let html = '';
        for (let i = 0; i < obj.length; i++) {
            // console.log(obj[i]);
            let pObj = obj[i];
            html += `
                <div class="lister">
                    <div class="list">
                        <img src="${pObj.classImgUrl}" alt="">
                        <ul class="goods">
                            <li class="goods-01">
                                <h3>小早熊</h3>
                                <p class="goods-p1">导师：${pObj.teacher.username}</p>
                            </li>
                            <li class="goods-02">
                                <h3>${pObj.className}</h3>
                                <p class="goods-p2">${pObj.classNumber}</p>
                            </li>
                        </ul>
                    </div>
                </div>
            `
        }
        xinzeng.innerHTML = html;
    })
}